package ch.nostromo.tiffanys.game.player;

import uk.ac.cam.cl.projectcharlie2010.engines.Engine;
import uk.ac.cam.cl.projectcharlie2010.game.player.PlayerEngine;
import uk.ac.cam.cl.projectcharlie2010.game.player.PlayerHuman;
import uk.ac.cam.cl.projectcharlie2010.game.player.physical.PhysicalPlayerListener;
import uk.ac.cam.cl.projectcharlie2010.game.player.physical.PlayerPhysical;
import ch.nostromo.tiffanys.engines.EngineSettings;


public class PlayerTools {

  @SuppressWarnings("unchecked")
  public static PlayerEngine createPlayerEngine(String name, EngineSettings engineSettings) {

    Class<Engine> possibleEngine = null;
    try {
      possibleEngine = (Class<Engine>) Class.forName(name);
    } catch (ClassNotFoundException ignored) {
      // Do nothing

    }
    return new PlayerEngine(possibleEngine, engineSettings);
  }

  public static PlayerHuman createPlayerHuman(String name) {
    return new PlayerHuman(name);
  }
  
  public static PlayerPhysical createPlayerPhysical(String name, PhysicalPlayerListener controller) {
	    return new PlayerPhysical(name, controller);
  }
  
}
